<?php
if(have_posts())
{
	while (have_posts())
	{
		the_post();
		$postID = get_the_ID();
		$title = get_the_title($postID);
		$thumbnail = db_get_post_meta($postID, $wpdb->prefix.'thumbnail');
		$permalink = get_permalink($postID);
		$alt = db_get_alt_attachment_id($postID, $wpdb->prefix.'thumbnail');
		if(!$alt)
			$alt = db_vietnamese_slug($title);
			
		$price = get_post_meta($postID, $wpdb->prefix.'price',true);
		$lenght = get_post_meta($postID, $wpdb->prefix.'lenght_of_stay',true);
		
		?>
		<li>
                    	<div class="bgdanhsachtour">
                        	<a href="<?php echo $permalink;?>"><img src="<?php echo $thumbnail;?>" alt="<?php echo $alt;?>" /></a>
                        </div>
                        <p class="tendanhsachtour"><a href="<?php echo $permalink;?>"><?php echo db_shortDesc($title,25);?></a></p>
                        <p class="giatour">Price: <?php echo $price;?> USD</p>
                        <p><?php echo $lenght;?></p>
                    </li>
		<?php 
	}
}
else 
{
	echo '<li> No Tour! </li>';
}